import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-11-11
 * Time: 20:39
 */
public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();
        String str = in.nextLine();
        int len = str.length();
        //1.找出字符串中数量最多的字母及其数量
        int maxCount = 0;
        String str1 = str.substring(0,1);
        for(int i = 0; i < len; i++) {
            str1 = str.substring(i,i+1);
            int count = 0;
            for(int j = i+1; j < len; j++) {
                String str2 = str.substring(j, j+1);
                if(str1.equals(str2)) {
                    count++;
                }
            }
            if(maxCount < count) {
                maxCount = count;
            }
        }
        //2.以数量最多的字母拆分字符串
        String[] string = str.split(str1);
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int x = in.nextInt();
        int[] v = new int[n];
        //int[] arr = new int[n];
        //int usedSize = 0;
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>(k);
        int j = 0;
        for(int i = 0; i < n; i++) {
            v[i] = in.nextInt();
            if(j++ < k) {
                priorityQueue.offer(v[i]);
            }
            // if(v[i] <= x) {
            //     arr[usedSize++] = v[i];
            // }
        }
        for(int i = k; i < n; i++) {
            int peekVal = priorityQueue.peek();
            if(peekVal > x) {
                priorityQueue.poll();
                priorityQueue.offer(v[i]);
            }else if(v[i] > x) {
                continue;
            }else if(peekVal < v[i]) {
                priorityQueue.poll();
                priorityQueue.offer(v[i]);
            }
        }
        int sum = 0;
        for(int i = 0; i < k; i++) {
            int pollVal = priorityQueue.poll();
            if(pollVal <= x) {
                sum += pollVal;
            }
        }
        System.out.println(sum);
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int x = in.nextInt();
        int[] v = new int[n];
        //1.统计小于x的商品价格
        int count = 0;
        for(int i = 0; i < n; i++) {
            v[i] = in.nextInt();
            if(v[i] <= x) {
                count++;
            }
        }
        //2.将符合要求的物品价格挑出来
        int[] arr = new int[count];
        int j = 0;
        for(int i = 0; i < n; i++) {
            if(v[i] <= x) {
                arr[j++] = v[i];
            }
        }
        //3.挑出符合要求物品价格最大的k件
        Arrays.sort(arr);
        int r = 0;
        for(int i = arr.length-1; i >= 0 && k > 0; i--) {
            r += arr[i];
            k--;
        }
        System.out.println(r);
    }
}
